/*	TM_FileNameFromPathTransformer.m
 *	Part of ThinkGeek LED Clock
 *	http://cs.beloit.edu/~morgant/thinkgeek/
 *
 * Copyright (c)2003-2005 Tim Morgan. All rights reserved.
 * Please visit http://cs.beloit.edu/~morgant/other/license.html
 * for more information about your rights and responsibilities
 * regarding this source code.
 */

#import "TM_FileNameFromPathTransformer.h"

@implementation TM_FileNameFromPathTransformer

+ (Class) transformedValueClass {
	return [NSString class];
}

- (id) transformedValue:(id)value {
	if (value != nil && ![value isKindOfClass:[NSString class]])
		[[NSException exceptionWithName:@"TGInvalidArgumentException"
								 reason:@"Tried to get the controller key for a view name that was not an NSString."
							   userInfo:nil] raise];
	
	return [value lastPathComponent];
}

@end
